Skip to content

fix(opentelemetry): Update GraphQL span naming property - #6750

Draft
adinauer wants to merge 3 commits into
mainfrom
fix/otel-graphql-property
Draft

adinauer wants to merge 3 commits into
mainfrom
fix/otel-graphql-property

Conversation

@adinauer

@adinauer adinauer commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

📜 Description

Updates the OpenTelemetry GraphQL configuration property that Sentry sets by default from the deprecated otel.instrumentation.graphql.add-operation-name-to-span-name.enabled key to otel.instrumentation.graphql.operation-name-in-span-name.enabled.

The default is now applied through OpenTelemetry's merged configuration. An explicitly configured current property takes precedence, while a value provided through the deprecated property is migrated to the current property. This preserves customer settings supplied through system properties, environment variables, or other OpenTelemetry configuration sources.

The GraphQL agent integration tests run with both the default semantic conventions and OpenTelemetry's v3 semantic conventions preview, where the deprecated key is ignored.

💡 Motivation and Context

OpenTelemetry renamed the property that adds GraphQL operation names to span names. Sentry continued setting the deprecated property, so enabling the v3 semantic conventions preview caused operation names such as GreetingQuery to be omitted from GraphQL span names. This made named GraphQL operations appear with generic span names instead of preserving the operation name.

Reading the merged configuration also avoids overriding customers who explicitly enable or disable operation names using either property name.

Refs #4547

💚 How did you test it?

  • make format api
  • ./gradlew ':sentry-opentelemetry:sentry-opentelemetry-agentcustomization:test' --tests='*SentryAutoConfigurationCustomizerProviderTest*'
  • ./gradlew ':sentry-spring-boot:integrationTestOtelAgent' ':sentry-spring-boot:integrationTestOtelAgentWithoutAutoInit' --tests='*Graphql*IntegrationTest*'

The configuration unit tests pass. The six GraphQL scenarios pass with both the default and v3 semantic conventions in both agent initialization modes.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

None.

adinauer and others added 2 commits November 24, 2026 10:56
OpenTelemetry replaced the GraphQL option used to add operation names to span names. The deprecated property is ignored when the v3 semantic conventions preview is enabled, causing named operations such as GreetingQuery to be exported with a generic span name.

Set the current property and run the GraphQL agent integration tests under the v3 preview to prevent a regression.

Refs #4547

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit de538d9.

Main concerns: public contract, reach, dependencies customers inherit.

Rules that block low also fired:

  • R6: build or release configuration changed: sentry-opentelemetry/sentry-opentelemetry-agentcustomization/build.gradle.kts

This label is a hint for reviewers, not an approval.

@sentry

sentry Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.65.1 (1) release

⚙️ sentry-android Build Distribution Settings

Read the merged OpenTelemetry configuration before applying Sentry's GraphQL span naming default. Preserve the current property when configured and migrate values supplied through the deprecated property instead of overriding customer settings.

Keep integration coverage for the default semantic conventions and add equivalent coverage for the v3 preview.

Refs #4547

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant